<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
		<script src="//cdn.bootcss.com/mustache.js/2.2.1/mustache.js"></script>
		<script>
			var view = [{
				title: "Joe",
				calc: function() {
					return 2 + 4;
				},
				sex: "同性恋",
				isOk: {name1:"www"}
			},{
				title: "aaa",
				calc: function() {
					return 2 + 4;
				},
				sex: "1111",
				isOk: {name1:"qq"}
			}];
			var output = Mustache.render("{{#.}}<li>{{title}} spends {{calc}}------{{#isOk}}{{name}}{{/isOk}} </li>{{/.}}", view);
			console.log(output);
		</script>
	</head>

	<body>
		&#x7b2c;
		<input type="button" name="test" id="test" value="test" /> &#x3000;&#x3000; &#x7B2C;&#x4E5D;&#x7AE0; &nbsp;

		<ul>
			<li></li>
			<li></li>
		</ul>
	</body>

</html>